const proxy = require('./proxy.config')
const path = require('path');
function resolve (dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    css: {
        loaderOptions: { // 向 CSS 相关的 loader 传递选项
            less: {
                javascriptEnabled: true
            }
        }
    },
    devServer: proxy,
    chainWebpack: (config)=>{
        config.resolve
            .symlinks(true)
        config.resolve.alias
            .set('@', resolve('src'))
            .set('assets',resolve('src/assets'))
            .set('components',resolve('src/components'))
            .set('layout',resolve('src/layout'))
            .set('base',resolve('src/base'))
            .set('static',resolve('src/static'))
        config.module
            .rule('vue')
            .test(/\.vue$/)

            .use('iview-loader')
            .loader('iview-loader')
            .options({
                prefix: true
            })
            .end()

    }

}
